home *** CD-ROM | disk | FTP | other *** search
/ Freelog 38 / Freelog038.iso / Bas / Bureautique / Ntl480 / Setup.exe / {app} / Libraries / Utilities.clb < prev    next >
Text File  |  2002-06-10  |  44KB  |  1,038 lines

  1. = V5 MultiLine NoSorting TabWidth=30
  2.  
  3. H=";About this library"
  4. This library was written by Fookes Software to serve as a demonstration of the varied tasks that can be performed by the Editor Clipbook. You are free to customize it any way you like!
  5.  
  6. You can get more information about each Clip, and how they should be used, by double-clicking on their colored section title.
  7.  
  8. If you have a useful Clipbook library that you would like to share with other NoteTab users, please submit it to: <clipbook@fookes.com>. Your library will then be added to the Clipbook repository on the web.
  9.  
  10.  
  11. H=";"
  12.  
  13.  
  14. H=";Clipbook Manager"
  15. Below, you will find a brief explanation about each Clip under this topic.
  16.  
  17. 1) Switch Library:
  18. Provides an alternative way to switch to another Clipbook library, and optionally hide the list.
  19.  
  20. 2) Install Libraries:
  21. Use this Clip to install libraries stored in other directories or disks. For example, libraries downloaded from the Internet or copied to a diskette from another computer. The Clip will copy the chosen libraries to NoteTab's Libraries subdirectory.
  22.  
  23. 3) Remove Libraries:
  24. You might have some libraries you created for temporary purposes, or that you downloaded from the Internet to try out but don't want to keep. This Clip makes it easy to remove those libraries. It sends them to the Windows recycle bin.
  25.  
  26.  
  27. H="Switch Library"
  28. ;Store list of library names in the variable LibraryList
  29. ^!Clip FillLibraryList
  30.  
  31. ;Show Clip wizard
  32. ^!Set %ShowClipbook%=^?{(T=C)Show Clipbook window?==_Yes|No}; %LibraryName%=^?{(H=10)Choose a library==_^%LibraryList%}
  33. ;Show or hide Clipbook window based on user's choice
  34. ^!ShowClipbook ^%ShowClipbook%
  35. ;Open chosen library. Remove first space character added by FillLibraryList Clip
  36. ^!LoadLibrary ^$StrDelete("^%LibraryName%";1;1)$
  37. ^!IfError Next ELSE Skip
  38. ^!Prompt Error: could not open "^%LibraryName%"
  39.  
  40.  
  41. H="Install Libraries"
  42. ;Clear variable in case it has been used previously
  43. ^!ClearVariable %LibraryList%
  44. ;Get value of last install directory from INI file, if available
  45. ^!Set %LibraryInstallPath%=^$GetValue(LibraryInstallPath)$
  46. ;Initialize variable for library search directory if it is empty
  47. ^!IfTrue ^$IsEmpty(^%LibraryInstallPath%)$ Next ELSE Skip
  48. ^!Set %LibraryInstallPath%=^$GetTmpPath$
  49.  
  50. ;Get library names to install
  51. ^!SetArray %LibraryNames%=^?{(T=O;S=M;F="Clipbook libraries (*.clb)|*.clb")Select libraries to install (no wildcards)=^%LibraryInstallPath%}
  52. ;Copy the value representing the number of items into the Count variable. The variable at index 0 indicates the number of items in the array
  53. ^!Set %Count%=^%LibraryNames0%
  54. ;If no files were chose, leave the loop
  55. ^!If ^%Count% = 0 Exit
  56. ;Check if first file exists; end the Clip if it doesn't
  57. ^!IfFileExist "^%LibraryNames1%" Continue ELSE Next
  58. ^!Prompt Error: "^%LibraryNames1%" not found
  59. ^!Goto Exit
  60.  
  61. :Continue
  62. ;Get path of libraries to install
  63. ^!Set %LibraryInstallPath%=^$GetPath("^%LibraryNames1%")$
  64. ;If path is same as libraries directory, then they are already installed so end Clip
  65. ^!IfSame "^%LibraryInstallPath%" "^$GetLibraryPath$" Exit
  66. ;Save install directory to INI file for eventual reuse
  67. ^!SaveValue LibraryInstallPath=^%LibraryInstallPath%
  68.  
  69. ;Initialize the Index variable to 0
  70. ^!Set %Index%=0
  71.  
  72. ;Beginning of loop
  73. :StartLoop
  74. ;Add one to the value contained in the variable Index
  75. ^!Inc %Index%
  76. ;End the Clip if the Index number is greater than the Count number
  77. ^!If ^%Index% > ^%Count% EndLoop
  78. ;Copy the library file name corresponding to the current index value to a variable. The content of the array's indexed variable is used here
  79. ^!Set %LibraryName%=^%LibraryNames^%Index%%
  80. ;Check if chosen library really exists
  81. ^!IfFileExist "^%LibraryName%" Next ELSE NotFound
  82. ;Check if library already exists in Libraries directory
  83. ^!IfFileExist "^$GetLibraryPath$^$GetFileName("^%LibraryName%")$" Next ELSE CopyLibrary
  84. ;Prompt user if library already exists and is going to be overwritten
  85. ^!Skip "^$GetFileName("^%LibraryName%")$" is already installed. Overwrite it?
  86. ;Jump back to the start of the loop if user answers no
  87. ^!Goto StartLoop
  88.  
  89. :CopyLibrary
  90. ;Copy library into Libraries directory
  91. ^!CopyFile "^%LibraryName%" "^$GetLibraryPath$"
  92. ;Append library name without path and extension to variable. Name is preceded with a space in case it starts with a special character. This space will have to be removed later
  93. ^!Append %LibraryList%= ^$GetName("^%LibraryName%")$|
  94. ;Jump back to the start of the loop
  95. ^!Goto StartLoop
  96.  
  97. :NotFound
  98. ^!Prompt Error: "^%LibraryName%" not found
  99. ^!Goto StartLoop
  100.  
  101. :EndLoop
  102. ^!Refresh
  103.  
  104. ;Get size of library list
  105. ^!Set %SizeList%=^$StrSize("^%LibraryList%")$
  106. ;Substract one from the SizeList value
  107. ^!Dec %SizeList%
  108. ;Format list so it can be used in Clip wizard
  109. ^!Set %LibraryList%=^$StrCopy("^%LibraryList%";1;^%SizeList%)$
  110.  
  111. ;Show appropriate wizard based on the number of installed libraries
  112. ^!If ^%Count% = 1 Next ELSE ChooseLibraryPrompt
  113. ;Copy library name from list variable to LibraryName variable
  114. ^!Set %LibraryName%=^%LibraryList%
  115. ;Show Clip wizard
  116. ^!Set %OpenLibraryName%=^?{(T=C)Would you like to open the new library?==_Yes|No}; %ShowClipbook%=^?{(T=C)Show Clipbook window?==_Yes|No}
  117. ;Jumpt to OpenLibrary label if user wants to open the newly installed library, otherwise end the Clip
  118. ^!IfTrue ^%OpenLibraryName% OpenLibrary ELSE Exit
  119.  
  120. :ChooseLibraryPrompt
  121. ;Show Clip wizard
  122. ^!Set %LibraryName%=^?{(H=5)Open new library?==_^%LibraryList%}; %ShowClipbook%=^?{(T=C)Show Clipbook window?==_Yes|No}
  123.  
  124. :OpenLibrary
  125. ;Show or hide Clipbook window based on user's choice
  126. ^!ShowClipbook ^%ShowClipbook%
  127. ;Remove first space character added by the Append instruction
  128. ^!Set %LibraryName%=^$StrDelete("^%LibraryName%";1;1)$
  129. ;Open chosen library
  130. ^!LoadLibrary ^%LibraryName%
  131. ^!IfError Next ELSE Skip
  132. ^!Prompt Error: could not open "^%LibraryName%"
  133.  
  134.  
  135. H="Remove Libraries"
  136. ;Store list of library names in the variable LibraryList
  137. ^!Clip FillLibraryList
  138.  
  139. ;Show Clip wizard
  140. ^!SetArray %LibraryNames%=^?{(H=10;T=A)Choose libraries to remove=^%LibraryList%}
  141. ;Copy the value representing the number of items into the Count variable. The variable at index 0 indicates the number of items in the array
  142. ^!Set %Count%=^%LibraryNames0%
  143. ;If no files were chose, leave the loop
  144. ^!If ^%Count% = 0 Exit
  145.  
  146. ;Initialize the Index variable to 0
  147. ^!Set %Index%=0
  148.  
  149. ;Beginning of loop
  150. :StartLoop
  151. ;Add one to the value contained in the variable Index
  152. ^!Inc %Index%
  153. ;End the Clip if the Index number is greater than the Count number
  154. ^!If ^%Index% > ^%Count% EndLoop
  155. ;Copy the library file name corresponding to the current index value to a variable. The content of the array's indexed variable is used here. Remove first space character added by FillLibraryList Clip
  156. ^!Set %LibraryName%=^$StrDelete("^%LibraryNames^%Index%%";1;1)$
  157. ;Remove the library by sending it to the Windows recycle bin
  158. ^!RecycleFile "^$GetLibraryPath$^%LibraryName%.clb"
  159. ;Jump back to the start of the loop
  160. ^!Goto StartLoop
  161.  
  162. :EndLoop
  163. ^!Refresh
  164. ^!Prompt ^%Count% libraries removed
  165.  
  166.  
  167. H=";"
  168.  
  169.  
  170. H=";Text Processing"
  171. Below, you will find a brief explanation about each Clip under this topic.
  172.  
  173. 1) Paste Internet acronym:
  174. When you activate this Clip, a Clip wizard will popup with a list of sentences that correspond to common Internet acronyms. Just double click on the item that you want to use and the corresponding acronym will be pasted in your document at the cursor position.
  175.  
  176. 2) Underline title:
  177. First place the cursor on the line you would like to underline, then activate the Clip. The Clip wizard will then let you choose the type of character to use for producing the underline text.
  178.  
  179. 3) Compare two files:
  180. The Clip uses the DOS command "fc" to compare the differences between two disk files. Although you can choose any two files you want to compare, NoteTab will offer the current document name by default for the first file. If necessary, NoteTab saves a temporary copy of the current document before starting the comparison program. Note that the Clip converts long file names to DOS short names so that they can be accepted by the "fc" utility.
  181.  
  182. 4) Enable AutoCorrect mode:
  183. When you activate this Clip, it will open the AutoCorrect library and then hide the Clipbook window. Auto-replace mode will be enabled and your typing will be checked for matching items in the library. If a typo is found, it will automatically be replaced with the correct spelling.
  184.  
  185.  
  186. H="Paste Internet acronym"
  187. ^?[(H=8)Choose acronym to paste==_By the Way^=BTW|For What it's Worth^=FWIW|For Your Information^=FYI|I Am Not A Lawyer^=IANAL|In Any Event^=IAE|In My Considered Opinion^=IMCO|In My Humble Opinion^=IMHO|In My Opinion^=IMO|In Other Words^=IOW|Just One of Those Things^=JOOTT|Laughing Out Loud^=LOL|No Reply Necessary^=NRN|On the Other Hand^=OTOH|Real Soon Now [Which May be a Long Time Coming]^=RSN|Rolling on Floor Laughing^=ROFL|Rolling on the Floor Laughing^=ROTFL|Still in the Dark^=SITD|Thanks in Advance^=TIA|There Ain't No Such Thing as a Free Lunch^=TANSTAAFL|Three Letter Acronym^=TLA|Tongue in Cheek^=TIC|With Respect To^=WRT]
  188.  
  189. H="Underline title"
  190. ;Underlines with the chosen character the line at the cursor
  191. ;Ensure input focus returns to document
  192. ^!FocusDoc
  193. ;Place the cursor at the end of the line
  194. ^!Jump LINE_END
  195. ;Determine the line length
  196. ^!Set %TitleLength%=^$Calc(^$GetColScreen$-1)$
  197. ;Cancel procedure if the line is blank
  198. ^!If ^%TitleLength% < 1 Exit
  199. ;Insert line break followed by sequence of underline characters
  200. ^!SetPasteIndent Off
  201. ^!InsertText ^P^$StrFill(^?{Underline character=_»|=|-|~|^|¿|╖};^%TitleLength%)$
  202.  
  203. H="Compare two files"
  204. ;The Clip uses the DOS command "fc" to compare the differences between two disk files. If necessary, NoteTab saves a temporary copy of the current document before starting the comparison program
  205. ;Define the delimiter for the checkbox field
  206. ^!SetListDelimiter " "
  207. ;Prompt for file names and option settings used to control the comparisor
  208. ^!Set %File1%="^?{(T=O)Compare file=^**}"; %File2%="^?{(T=O)With file=^$GetPath("^**")$}"; %Options%=^?{(H=5;T=A)Switches=_Compares files as ASCII text^=/L|Ignore character case^=/C|Display only first+last lines^=/A|_Do not expand tabs to spaces^=/T|Display line numbers on an ASCII comparison^=/N}
  209. ;End the procedure if no file is specified
  210. ^!IfTrue ^$IsEmpty("^%File1%")$ End
  211.  
  212. ;Set output file name in a variable
  213. ^!Set %OutputFile%=^$GetName("^%File1%")$.dif
  214. ;Convert long file names to DOS short names
  215. ^!Set %File1%=^$GetShort("^%File1%")$
  216. ^!Set %File2%=^$GetShort("^%File2%")$
  217. ;Copy the file path in a variable
  218. ^!Set %Path%=^$GetPath("^%File1%")$
  219.  
  220. ;If both files being compared are in the same directory, remove the path part from the second file name
  221. ^!IfSame "^%Path%" "^$GetPath("^%File2%")$" Next ELSE Skip
  222. ^!Set %File2%=^$GetFileName("^%File2%")$
  223.  
  224. ;Create and save the command line in a variable
  225. ^!Set %Command%=fc ^%Options% ^$GetFileName("^%File1%")$ ^%File2% >^%OutputFile%
  226. ;Show warning if command line exceeds the normal DOS length limit
  227. ^!If ^$StrSize("^%Command%")$ > 127 Warning ELSE Execute
  228.  
  229. :Warning
  230. ^!Info Warning: the DOS command line about to be executed is very long; it might not work. In case of failure, try to shorten the path/file names of the documents you want to compare.
  231.  
  232. :Execute
  233. ;Delete the output file if it already exists (created by earlier comparison)
  234. ^!DeleteFile ^%OutputFile%
  235. ;Set the default path
  236. ^!ChDir ^%Path%
  237. ;Execute the fc command with all parameters
  238. ^!CmdShow Minimize
  239. ^!DOS ^%Command%
  240. ;Wait until the command has finished executing
  241. ^!Wait
  242. ;Copy output name to variable
  243. ^!Set %OutputFile%=^%Path%^%OutputFile%
  244. ;Open the output file if it exists or show error message
  245. ^!IfFileExist ^%OutputFile% Next ELSE Error
  246. ^!Open ^%OutputFile%
  247. ^!Goto End
  248.  
  249. :Error
  250. ^!Info File comparison failed
  251.  
  252. H="Enable AutoCorrect mode"
  253. ;Opens the AutoCorrect library in the Editor Clipbook
  254. ^!LoadLibrary AutoCorrect.clb
  255. ;Hides the Clipbook window
  256. ^!ShowClipbook False
  257.  
  258. H=";"
  259.  
  260.  
  261. H=";Without Clipboard"
  262. The Clips in this section provide typical Clipboard functions without actually using it. The cut and copy procedures actually copy the text selection to a temporary variable in the Clipbook.
  263.  
  264. 1) Copy/paste:
  265. Performs copy and paste operations without using the Windows Clipboard. If text is selected, NoteTab assumes you want to perform a Copy operation. If no text is selected but a Copy or Cut operation has been performed beforehand, Notetab will paste the copied text into the document.
  266.  
  267. 2) Cut/paste:
  268. Performs cut and paste operations without using the Windows Clipboard. If text is selected, NoteTab assumes you want to perform a Cut operation. If no text is selected but a Copy or Cut operation has been performed beforehand, Notetab will paste the copied text into the document.
  269.  
  270. 3) Duplicate line:
  271. Duplicates the line at the cursor.
  272.  
  273.  
  274. H="Copy/paste"
  275. ;Performs copy and paste operations without using the Windows Clipboard
  276. ;If text is selected, NoteTab assumes you want to perform a Copy operation. If no text is selected but a Copy or Cut operation has been performed beforehand, Notetab will paste the copied text into the document
  277. ^!FocusDoc
  278. ^!If ^$GetSelSize$ = 0 Next ELSE CopyText
  279. ^!IfTrue ^$IsEmpty("^%KeepText%")$ End
  280. ^!SetPasteIndent Off
  281. ^!InsertCode ^%KeepText%
  282. ^!GoTo End
  283. :CopyText
  284. ^!SetCode %KeepText%=^$GetSelection$
  285. ^!Jump Select_End
  286.  
  287. H="Cut/paste"
  288. ;Performs cut and paste operations without using the Windows Clipboard
  289. ;If text is selected, NoteTab assumes you want to perform a Cut operation. If no text is selected but a Copy or Cut operation has been performed beforehand, Notetab will paste the copied text into the document
  290. ^!FocusDoc
  291. ^!If ^$GetSelSize$ = 0 Next ELSE CutText
  292. ^!IfTrue ^$IsEmpty("^%KeepText%")$ End
  293. ^!SetPasteIndent Off
  294. ^!InsertCode ^%KeepText%
  295. ^!GoTo End
  296. :CutText
  297. ^!SetCode %KeepText%=^$GetSelection$
  298. ^!InsertText ^%EMPTY%
  299.  
  300. H="Duplicate line"
  301. ;Duplicates the line at the cursor
  302. ^!FocusDoc
  303. ;Start by selecting the current line (or word-wrapped line)
  304. ^!Select Paragraph
  305. ;End the procedure if the line is empty
  306. ^!If ^$GetSelSize$ = 0 End
  307. ;Copy the selection into a variable
  308. ^!Set %ParaText%=^$GetSelection$
  309. ;Place cursor at end of selection and remove highlight
  310. ^!Jump Select_End
  311. ;Check if the paragraph ends with a line break; if not, add one to the front of our copy in the variable
  312. ^!If ^$StrCopyRight("^%ParaText%";2)$ = ^%NL% Skip
  313. ^!SetCode %ParaText%=^%NL%^%ParaText%
  314. ;Insert copied line back into document
  315. ^!InsertCode ^%ParaText%
  316.  
  317.  
  318. H=";"
  319.  
  320.  
  321. H=";Internet"
  322. This section offers several useful commands to tidy or generate web pages, or convert HTML documents to plain text.
  323.  
  324. 1) Images to HTML:
  325. This Clip will create a web page based on all the images that match a specified criteria. You can then easily preview all the images in your favorite browser. Before the web page is created, a Clip wizard is displayed so you can choose which directory it should search, what type of images it should include in the page, and the sorting order. The resulting web page displays all the matching images, together with their file name, the picture's dimensions in pixels (width and height), and the file size. You can then put this page together with your pictures on a web server.
  326.  
  327. 2) Tidy HTML code:
  328. This Clip will change the format of your HTML tags and clean up the code in all open HTML documents. The internal NoteTab commands let you choose between upper/lower case tags, or the new XHTML format. If you have installed the HTML Tidy program, you can also change the indenting and column wrap. Furthermore, HTML Tidy can correct minor errors in your code.
  329.  
  330. 3) Convert HTML to text:
  331. This Clip will convert all the HTML documents open in NoteTab into plain text files. A Clip wizard gives you the choice to keep the links in tags or not, and to automatically save the resulting text files or not.
  332.  
  333. 4) Convert Text to HTML:
  334. This Clip will convert all the non-HTML documents open in NoteTab into web pages. A Clip wizard gives you the choice to automatically save the resulting HTML files or not.
  335.  
  336. 5) Convert "Mailto" form:
  337. This Clip will convert output generated by "Mailto" forms into plain text. If text is initially selected in the document, the conversion will only be applied to that part, otherwise the whole document is processed.
  338.  
  339. 6) Outline document to HTML:
  340. Converts the current outline document into a web page with table of contents and links. If the current document is not an outline, the Clip will offer to demonstrate the feature on the Readme.otl document, which is part of the NoteTab package.
  341.  
  342. 7) Outline topics to HTML:
  343. This Clip will convert each outline topic into an individual web page. You can choose whether to keep the created HTML files open in NoteTab or have them closed automatically. If the current document is not an outline, the Clip will offer to demonstrate the feature on the Readme.otl document, which is part of the NoteTab package.
  344.  
  345. 8) Select between tags:
  346. This Clip will select all the text between the type of tag specified by the user. The search starts from the cursor position or the beginning of the text, depending on the users choice.
  347.  
  348. 9) Insert HRef Link:
  349. Opens the Clip wizard so you can choose which web page and description you want to use in the link. The Clip then inserts the HRef tag into your document at the cursor position.
  350.  
  351. 10) Insert Img Link:
  352. Opens the Clip wizard so you can choose which image and ALT description you want to use in the link. The Clip then inserts the Img tag, complete with the image size attributes into your document at the cursor position.
  353.  
  354.  
  355. H="Images to HTML"
  356. ;This Clip will create a web page based on all the images that match the specified criteria. You can then easily preview all the images in your favorite browser
  357.  
  358. ;Prompt user with Clip wizard to determine which image files should be listed and how the page should be built
  359. ^!Set %PageTitle%=^?{Page title=Images}; %FileName%=^?{Web page file name (no path or extension)=Images}; %Directory%=^?{(T=D)Directory to search}; %Specs%=^?{File Specs=*.gif;*.png;*.jpg}; %Sorting%=^?{(T=C)File sorting==Unsorted|_Name|Type|Date|Size}; %Reverse%=^?{(T=C)Descending order==Yes^=Rev|_No^=}
  360. ;End procedure if the user canceled the Clip wizard
  361. ^!IfCancel Exit
  362.  
  363. ^!SetPasteIndent Off
  364. ;Set variable for sorting parameter
  365. ^!Set %Sorting%=^%Reverse%^%Sorting%
  366. ;Close the output file if there is one open in NoteTab
  367. ^!Close "^%Directory%^%FileName%.htm"
  368. ;Create a new document with specified name for web page
  369. ^!Set %KeepNameFormat%=^$GetNameFormat$
  370. ^!SetNameFormat ^%Directory%^%FileName%.htm
  371. ^!ToolBar New Document
  372. ^!SetNameFormat ^%KeepNameFormat%
  373. ;Turn word wrap off
  374. ^!SetWordWrap OFF
  375. ;Insert web page header and title
  376. ^!InsertHtml <HTML>^P<HEAD>^P<TITLE>^%PageTitle%</TITLE>^P<META name="generator" content="^$GetProgName$ ^$GetProgVersion$">^P</HEAD>^P<BODY>^P<CENTER>^P<H1>^%PageTitle%</H1>^P<H2>^%Directory%^%Specs%</H2>^P<HR>^P</CENTER>^P
  377.  
  378. ;Retrieve first image name that matches specified search criteria
  379. ^!Set %ImageFullName%=^$GetFileFirst(^%Directory%;"^%Specs%";^%Sorting%)$
  380. :StartLoop
  381. ;If the image name is empty (no more matching files), leave the loop
  382. ^!IfTrue ^$IsEmpty(^%ImageFullName%)$ ExitLoop
  383. ;Copy image name without path to variable
  384. ^!Set %ImageName%=^$GetFileName(^%ImageFullName%)$
  385. ;Copy image width and height information into variables
  386. ^!Set %ImgWidth%=^$GetImgWidth(^%ImageFullName%)$; %ImgHeight%=^$GetImgHeight(^%ImageFullName%)$
  387. ;Insert image tag and information into document
  388. ^!InsertHtml <IMG SRC="^$StrLower("^%ImageName%")$" WIDTH="^%ImgWidth%" HEIGHT="^%ImgHeight%" BORDER="0" ALT="^%ImageName%"><BR>^%ImageName% (^%ImgWidth%x^%ImgHeight%; ^$GetFileSize(^%ImageFullName%)$ bytes)<P>^P
  389.  
  390. ;Get next matching image name and go back to start of loop
  391. ^!Set %ImageFullName%=^$GetFileNext$
  392. ^!GoTo StartLoop
  393.  
  394. :ExitLoop
  395. ;Close the file-find variable to restore system resources
  396. ^!CloseFileFind
  397. ;Insert line break after last image tag
  398. ^!InsertText ^P
  399. ;Insert web page closing tags
  400. ^!InsertHtml <HR>^P<CENTER>^P<I>This HTML document was produced with a popular Text and HTML editor called <B><A HREF="http://www.notetab.com/">^$GetProgName$</A></B></I>^P</CENTER>^P<HR>^P<SMALL>Page created on <B>^$GetDate(mmmm dd, yyyy)$</B></SMALL>^P</BODY>^P</HTML>^P
  401.  
  402. ;Place cursor back to top of page
  403. ^!Jump Text_Start
  404. ;Offer user the choice to display the newly created web page in browser or end Clip
  405. ^!Goto ^?{What would you like to do now?==_View page in main browser^=Next|View page in second browser^=SecondBrowser|No preview^=End}
  406. ^!ToolBar View in Browser
  407. ^!Goto End
  408. :SecondBrowser
  409. ^!ToolBar View Other Browser
  410.  
  411. H="Tidy HTML code"
  412. ;Tidy code in all open HTML documents. This Clip can use the HTML Tidy program, if available
  413. ^!Continue This Clip will tidy the code in all open HTML documents. Continue?
  414.  
  415. ;Copy the document count in a variable
  416. ^!Set %Index%=^$GetDocCount$
  417.  
  418. ;Determine method to use
  419. ^!Set %UseHtmlTidy%=No
  420. ^!IfFileExist "^$GetTidyExe$" ^!Set %UseHtmlTidy%=Yes
  421. ^!IfFalse ^%UseHtmlTidy% InitPlain
  422. ;If HTML Tidy is found, ask which method the user would like to use
  423. ^!Set %UseHtmlTidy%=^?{Select method==_Use HTML Tidy program (more options)^=Yes|Use NoteTab commands (much faster)^=No}
  424. ^!IfTrue ^%UseHtmlTidy% InitTidy
  425.  
  426. :InitPlain
  427. ^!Set %Param%=^?{Tag format?==_Uppercase|Lowercase|XHTML}; %SaveChanges%=^?{Automatically save changed documents?==Yes|_No}; %Label%=CallPlain
  428. ^!Goto LoopStart
  429.  
  430. :InitTidy
  431. ^!Set %Param%=--tidy-mark false -q^?{Indent HTML code?==_Yes^=i|No^=}^?{Tag format?==_Uppercase^=u|Lowercase^=|XHTML^= -asxml}^?{Wrap long lines?==Yes^=|_No^= -wrap 0}; %SaveChanges%=^?{Automatically save changed documents?==Yes|_No}; %Label%=CallTidy
  432.  
  433. ;Check every open document through the following loop
  434. :LoopStart
  435. ;Activate the specified document (starts with the last one in the tab bar)
  436. ^!SetDocIndex ^%Index%
  437. ;Skip the conversion process if the document does not have an HTML extension or is a Clipbook library
  438. ^!IfFalse ^$IsHTMLDoc$ UpdateIndex
  439. ^!IfTrue ^$IsClipDoc$ UpdateIndex
  440. ^!Goto ^%Label%
  441.  
  442. ;Tidy the contents of the current document
  443. :CallPlain
  444. ^!Select ALL
  445. ^!InsertText ^$GetHtmlTextTidy("^$GetSelection$";^%Param%)$
  446. ^!Goto EndCall
  447.  
  448. :CallTidy
  449. ^!RunTidy ^%Param%
  450. ^!IfError UpdateIndex
  451.  
  452. :EndCall
  453. ;Place the cursor at the start of the document
  454. ^!Jump Text_Start
  455. ;Save converted document if users wants this done automatically
  456. ^!IfFalse ^%SaveChanges% UpdateIndex
  457. ^!IfFalse ^$IsModified$ UpdateIndex
  458. ^!Save
  459.  
  460. :UpdateIndex
  461. ;Substract one from the Index value
  462. ^!Dec %Index%
  463. ;Go back to start of loop if there are still documents left to check
  464. ^!If ^%Index% > 0 LoopStart
  465.  
  466. H="Convert HTML to text"
  467. ;Converts all open HTML documents into plain text files
  468. ^!Continue This Clip will convert all open HTML documents to plain text files. Continue?
  469. ;Copy the document count in a variable
  470. ^!Set %Index%=^$GetDocCount$
  471.  
  472. ;Check every open document through the following loop
  473. :LoopStart
  474. ;Activate the specified document (starts with the last one in the tab bar)
  475. ^!SetDocIndex ^%Index%
  476. ;Skip the conversion process if the document does not have an HTML extension or is a Clipbook library
  477. ^!IfFalse ^$IsHTMLDoc$ SkipConversion
  478. ^!IfTrue ^$IsClipDoc$ SkipConversion
  479. ;Strip tags from current document
  480. ^!Toolbar Strip ^?[Keep links in tags?==_Yes^=Tags|No^=HTML]
  481. ^!IfError SkipConversion
  482. ;Place the cursor at the start of the document
  483. ^!Jump Text_Start
  484. ;Save converted document if users wants this done automatically
  485. ^!IfFalse ^?[Automatically save converted documents?==_Yes|No] Skip
  486. ^!Save As ^##
  487.  
  488. :SkipConversion
  489. ;Substract one from the Index value
  490. ^!Dec %Index%
  491. ;Go back to start of loop if there are still documents left to check
  492. ^!If ^%Index% > 0 LoopStart
  493.  
  494. H="Convert Text to HTML"
  495. ;Converts all open non-HTML documents to HTML
  496. ^!Continue This Clip will convert all open non-HTML documents to HTML documents. Continue?
  497. ;Copy the document count in a variable
  498. ^!Set %Index%=^$GetDocCount$
  499.  
  500. ;Check every open document through the following loop
  501. :LoopStart
  502. ;Activate the specified document (starts with the last one in the tab bar)
  503. ^!SetDocIndex ^%Index%
  504. ;Skip the conversion process if the document has an HTML extension or is a Clipbook library
  505. ^!IfTrue ^$IsHtmlDoc$ SkipConversion
  506. ^!IfTrue ^$IsClipDoc$ SkipConversion
  507. ;Convert text to HTML format
  508. ^!Toolbar Document to HTML
  509. ^!IfError SkipConversion
  510. ;Place the cursor at the start of the document
  511. ^!Jump Text_Start
  512. ;Save converted document if users wants this done automatically
  513. ^!IfFalse ^?[Automatically save converted documents?==_Yes|No] Skip
  514. ^!Save As ^##
  515.  
  516. :SkipConversion
  517. ;Substract one from the Index value
  518. ^!Dec %Index%
  519. ;Go back to start of loop if there are still documents left to check
  520. ^!If ^%Index% > 0 LoopStart
  521.  
  522. H="Convert "Mailto" form"
  523. ;Converts output text created by "Mailto" forms. If text is selected in the document, the conversion will only be applied to that part, otherwise the whole document is processed
  524. ^!If ^$GetSelSize$ > 2 Skip
  525. ^!ToolBar Select All
  526. ^!If ^$GetSelSize$ = 0 End
  527. ^!SetPasteIndent Off
  528. ^!InsertText ^$StrUrlDecode("^$GetSelection$")$
  529.  
  530. H="Outline document to HTML"
  531. ;Converts the current outline document into a web page
  532.  
  533. ;If the current document is an outline, start the procedure. Otherwise ask whether to demonstrate the feature on the Readme.otl document, which is part of the NoteTab package
  534. ^!IfTrue ^$IsOutlineDoc$ Start ELSE Next
  535. ;Check if the Readme.otl document exists. If not, skip demonstration procedure and show error message
  536. ^!IfFileExist ^$GetAppPath$Readme.Otl Next ELSE ShowErrorMsg
  537. ^!Continue The current document is not an outline. Would you like to see a demonstration with the Readme.Otl file?
  538. ;Open the Readme.otl document
  539. ^!Open ^$GetAppPath$Readme.Otl
  540. ;If there was an error while trying to open it, show message and end procedure
  541. ^!IfError Next ELSE Start
  542. ^!Prompt Error: could not open "^$GetAppPath$Readme.Otl"
  543.  
  544. :Start
  545. ;Convert the outline file to HTML format
  546. ^!Toolbar Document to HTML
  547. ;Place the cursor at the start of the document
  548. ^!Jump Text_Start
  549. ;Offer user the choice to display the newly created web page in browser or end Clip
  550. ^!Goto ^?{What would you like to do now?==_View page in main browser^=Next|View page in second browser^=SecondBrowser|No preview^=End}
  551. ^!ToolBar View in Browser
  552. ^!Goto End
  553.  
  554. :SecondBrowser
  555. ^!ToolBar View Other Browser
  556. ^!Goto End
  557.  
  558. :ShowErrorMsg
  559. ^!Prompt Error: the current document is not an outline
  560.  
  561. H="Outline topics to HTML"
  562. ;This Clip will convert each outline topic into an individual web page. The user can choose whether to keep the created files open in NoteTab or have them closed automatically
  563.  
  564. ;If the current document is an outline, start the procedure. Otherwise ask whether to demonstrate the feature on the Readme.otl document, which is part of the NoteTab package
  565. ^!IfTrue ^$IsOutlineDoc$ Start ELSE Next
  566. ;Check if the Readme.otl document exists. If not, skip demonstration procedure and show error message
  567. ^!IfFileExist ^$GetAppPath$Readme.Otl Next ELSE ShowErrorMsg
  568. ^!Continue The current document is not an outline. Would you like to see a demonstration with the Readme.Otl file?
  569. ;Open the Readme.otl document
  570. ^!Open ^$GetAppPath$Readme.Otl
  571. ;If there was an error while trying to open it, show message and end procedure
  572. ^!IfError Next ELSE Start
  573. ^!Prompt Error: could not open "^$GetAppPath$Readme.Otl"
  574.  
  575. :Start
  576. ;Copy the name of the outline document to a variable
  577. ^!Set %OutlineName%=^$GetName("^##")$
  578. ;Copy user's choice for keeping the web pages open or not
  579. ^!Set %KeepOpen%=^?[Keep new HTML documents open in editor?==_Yes|No]
  580. ;Store the current document index in a variable
  581. ^!Set %DocIndex%=^$GetDocIndex$
  582. ;Set the TopicIndex variable to 0
  583. ^!Set %TopicIndex%=0
  584. ;Store the topic count in a variable
  585. ^!Set %TopicCount%=^$GetTopicCount$
  586. ;Change the name format for newly created documents to the outline file name with the .html extension
  587. ^!Set %KeepNameFormat%=^$GetNameFormat$
  588. ^!SetNameFormat ^$GetAppPath$^%OutlineName%%0.2d.html
  589.  
  590. :LoopStart
  591. ;Add one to the value contained in the TopicIndex variable
  592. ^!Inc %TopicIndex%
  593. ;End the Clip if the TopicIndex number is greater than the number of topics in the outline document
  594. ^!If ^%TopicIndex% > ^%TopicCount% EndClip
  595. ;Activate the outline document if it is not already the current one
  596. ^!SetDocIndex ^%DocIndex%
  597. ;Move to the topic defined in the TopicIndex variable
  598. ^!SetTopicIndex ^%TopicIndex%
  599. ;Copy the content of the topic to the Clipboard
  600. ^!SetClipboard ^$GetText$
  601. ;Paste the content of the Clipboard into a new document
  602. ^!ToolBar Paste New
  603. ;Convert the text in the new document to the HTML format
  604. ^!Toolbar Document to HTML
  605. ;Place the cursor at the start of the text in the new HTML document
  606. ^!Jump Text_Start
  607. ;Save the new HTML document without prompting the user for the name
  608. ^!Save AS ^##
  609. ;Close the HTML document if the user chose to do so
  610. ^!IfTrue ^%KeepOpen% Skip
  611. ^!Close
  612. ;Go back to the start of the loop
  613. ^!GoTo LoopStart
  614.  
  615. :ShowErrorMsg
  616. ^!Prompt Error: the current document is not an outline
  617. ^!GoTo End
  618.  
  619. :EndClip
  620. ;Restore the original new document name format
  621. ^!SetNameFormat ^%KeepNameFormat%
  622.  
  623. H="Select between tags"
  624. ;This Clip will select all the text between the type of tag specified by the user. The search starts from the cursor position or the beginning of the text
  625.  
  626. ^!Set %Range%=^?[(2)Search from...==Start of text^=W|Cursor position forwards^=|_Cursor position backwards^=B]
  627. ;If search direction is different from backwards, jump to the instruction following the SearchForwards label
  628. ^!If ^%Range% <> B SearchForwards
  629. ;Clear the content of the Range variable
  630. ^!ClearVariable %Range%
  631. ;Search backwards for the first matching tag
  632. ^!Find "<^?[(1)Tag=a|address|applet|b|big|blockquote|body|caption|center|em|form|frameset|font|head|i|iframe|li|kbd|noframes|noscript|ol|option|p|pre|script|small|strike|strong|style|table|td|th|title|tr|ul|var]" ISB
  633. ;End procedure if the searched tag is not found
  634. ^!IfError End
  635. ;Place cursor at end of selection and remove highlight
  636. ^!Jump Select_End
  637. ;Find end of opening tag
  638. ^!Find ">" IS
  639. ^!IfError End
  640. ^!Goto SetStartPosition
  641.  
  642. :SearchForwards
  643. ;Search forwards for the opening tag
  644. ^!Find "<^?[Tag]" CIS^%Range%
  645. ;End procedure if the searched tag is not found
  646. ^!IfError End
  647. ;Place cursor at end of selection and remove highlight
  648. ^!Jump Select_End
  649. ;Find end of opening tag
  650. ^!Find ">" S
  651. ^!IfError End
  652.  
  653. :SetStartPosition
  654. ;Ensure input focus is in the document
  655. ^!FocusDoc
  656. ;Place cursor at end of selection and remove highlight
  657. ^!Jump Select_End
  658. ;Store cursor position in a variable
  659. ^!Set %Start%=^$GetRow$:^$GetCol$
  660. ;Search for the closing tag
  661. ^!Find "</^?[Tag]>" IS
  662. ;End the procedure if it is not found
  663. ^!IfError End
  664.  
  665. ;Place cursor at start of selection and remove highlight
  666. ^!Jump Select_Start
  667. ;Store cursor position in a variable
  668. ^!Set %End%=^$GetRow$:^$GetCol$
  669. ;Move the cursor back to the first saved position (after the opening tag)
  670. ^!SetCursor ^%Start%
  671. ;Extend the selection to the second saved position (in front of the closing tag)
  672. ^!SelectTo ^%End%
  673.  
  674. H=";"
  675.  
  676.  
  677. H=";Conversions"
  678. This section offers a series of Clips that let you easily convert between the most common units. A Clip wizard will prompt you for the value to convert and will then display the result in another window.
  679.  
  680.  
  681.  
  682. H="Fahrenheit -> Centigrade"
  683. ^!Prompt ^?[Temperature in Fahrenheit]░F = ^$Calc(((^?[Temperature in Fahrenheit])-32)*(5/9))$░C
  684.  
  685. H="Centigrade -> Fahrenheit"
  686. ^!Prompt ^?[Temperature in Centigrade]░C = ^$Calc((^?[Temperature in Centigrade])*(9/5)+32)$░F
  687.  
  688. H=";----"
  689.  
  690.  
  691. H="Inches -> Centimetres"
  692. ^!Prompt ^?[Length in inches] inches = ^$Calc(^?[Length in inches]*2.5400)$ cm
  693.  
  694. H="Centimetres -> Inches"
  695. ^!Prompt ^?[Length in centimetres] cm = ^$Calc(^?[Length in centimetres]/2.5400)$ inches
  696.  
  697. H="Miles -> Kilometres"
  698. ^!Prompt ^?[Distance in miles] miles = ^$Calc(^?[Distance in miles]/0.6214)$ kilometres
  699.  
  700. H="Kilometres -> Miles"
  701. ^!Prompt ^?[Distance in kilometres] kilometres = ^$Calc(^?[Distance in kilometres]*0.6214)$ miles
  702.  
  703. H=";----"
  704.  
  705.  
  706. H="Pounds -> Kilograms"
  707. ^!Prompt ^?[Weight in pounds] pounds = ^$Calc(^?[Weight in pounds]*0.4536)$ kg
  708.  
  709. H="Kilograms -> Pounds"
  710. ^!Prompt ^?[Weight in kilograms] kg = ^$Calc(^?[Weight in kilograms]/0.4536)$ pounds
  711.  
  712. H=";"
  713.  
  714.  
  715. H=";Mathematics"
  716. This section offers a series of Clips that demonstrate how NoteTab can calculate mathematical formulae. A Clip wizard will prompt you for the necessary values and will then display the result in another window.
  717.  
  718.  
  719.  
  720. H="Your ideal weight?"
  721. ;Lorentz Formula (thanks Christophe!)
  722. ^!Prompt Ideal weight = ^$Calc((^?[Height (cm)]-100)-((^?[Height (cm)]-150)/^?[Sex=_Male^=4|Female^=2]))$ Kg
  723.  
  724. H="Mortgage rate"
  725. ;Clip developed by Edward S. Wozniak
  726. ^!Prompt Mortgage rate = ^$Calc(^?[Mortgage amount]*(^?[Interest rate (%)]/1200)*(1+^?[Interest rate (%)]/1200)^(^?[Length of the loan (in years)]*12)/((1+^?[Interest rate (%)]/1200)^(^?[Length of the loan (in years)]*12)-1))$ per month
  727.  
  728. H="Future value of deposit"
  729. ;Clip developed by Edward S. Wozniak
  730. ^!Prompt Final Balance = ^$Calc(^?[Fixed Monthly Deposit]*((1+^?[Interest Rate (%)]/1200)^(^?[Total Deposit Periods (in years)]*12)-1)/(^?[interest Rate (%)]/1200))$
  731.  
  732. H=";"
  733.  
  734.  
  735. H=";Windows Utilities"
  736. This section offers Clips that launch some of the commonly used Windows utilities. Just double click on the Clip to start the utility.
  737.  
  738.  
  739.  
  740. H="Calculator"
  741. ^!FocusApp Calculator
  742. ^!IfError Next Else End
  743. ^!Shell calc.exe
  744.  
  745. H="Character Map"
  746. ^!Shell charmap.exe
  747.  
  748. H="Explorer"
  749. ^!FocusApp Exploring*
  750. ^!IfError Next Else End
  751. ^!Shell explorer.exe
  752.  
  753. H=";"
  754.  
  755.  
  756. H=";UNICODE files"
  757. This section offers Clips that let you easily read and write text in UNICODE format.
  758.  
  759.  
  760.  
  761. H="Import UNICODE text"
  762. ;Prompts user to choose an UNICODE file and reads text into NoteTab
  763. ^!ToolBar New Document
  764. ^!InsertText ^$GetUnicodeFileText("^?[(T=O;F="UNICODE files (*.txt)|*.txt")Open UNICODE file]")$
  765.  
  766. H="Save as UNICODE file"
  767. ;Saves current document in UNICODE format
  768. ^!Continue This command will save the text in your current document to a new file in UNICODE format. Continue?
  769. ^!TextToUnicodeFile "^?{(T=S;F="UNICODE files (*.txt)|*.txt")Save As UNICODE file}"
  770.  
  771. H=";"
  772.  
  773.  
  774. H=";EBCDIC files"
  775. This section offers a series of Clips that let you easily open, save, and export EBCDIC files.
  776.  
  777.  
  778.  
  779. H="Load EBCDIC conversion table"
  780. ;Loads an EBCDIC character conversion table into NoteTab
  781. ^!LoadEbcdicCharTable ^?[(T=O;F="Character Tables (*.ebc)|*.ebc")Load EBCDIC character table=Default.ebc]
  782. ^!IfError Next ELSE Skip
  783. ^!Info Error loading EBCDIC translation table
  784.  
  785. H="Open EBCDIC document"
  786. ;Prompts user to choose an EBCDIC file(s) and opens in NoteTab
  787. ^!OpenEbcdic ^?{(T=O;S=M;F="EBCDIC files (*.cbl;*.cob;*.cpy;*.ddl;*.bms)|*.cbl;*.cob;*.cpy;*.ddl;*.bms")Open EBCDIC file(s)} /W=^?{LRECL=_Variable Width^=0|80|132|133}
  788.  
  789. H="Save document as EBCDIC"
  790. ;Saves current document in EBCDIC format
  791. ^!Continue This command will save your current document as an EBCDIC file. Are you sure you want to do this?
  792. ^!SaveEbcdic /W=^?{Line width (LRECL)=_Variable Width^=0|80|132|133}
  793.  
  794. H="Export as EBCDIC"
  795. ;Saves current document or text selection as a new file in EBCDIC format
  796. ^!Export "^?[(T=S;F="EBCDIC files (*.cbl;*.cob;*.cpy;*.ddl;*.bms)|*.cbl;*.cob;*.cpy;*.ddl;*.bms")Name for new EBCDIC file]" EBCDIC ^?[Text=SELECTION|_ALL] LRECL=^?[Line width (LRECL)=_Variable Width^=0|80|132|133]
  797.  
  798. H=";"
  799.  
  800.  
  801. H=";UUEncode/UUDecode"
  802. This section offers Clips that let you process UUEncoded data.
  803.  
  804.  
  805.  
  806. H="UUEncode file"
  807. ;Converts the chosen file to UUEncoded format and saves the result to a new file with the extension .uue
  808. ^!UUEncode "^?[(T=O)File to UUEncode]"
  809. ^!IfError ShowError
  810. ^!Prompt UUEncode successful
  811. ^!Goto End
  812.  
  813. :ShowError
  814. ^!Prompt An error has occured during the encoding process
  815.  
  816.  
  817. H="UUDecode file"
  818. ;Converts the chosen UUEncoded file to its native format and saves the result to a new file with its original name
  819. ^!UUDecode "^?[(T=O;F="UUEncoded files (*.uue)|*.uue")File to UUDecode]"
  820. ^!IfError ShowError
  821. ^!Prompt UUDecode successful
  822. ^!Goto End
  823.  
  824. :ShowError
  825. ^!Prompt An error has occured during the decoding process
  826.  
  827.  
  828. H="UUEncode text"
  829. ;Converts the text in the current document to UUEncoded format and saves it to a new document
  830. ^!SetCode %Text%=^$GetText$
  831. ^!ToolBar New Document
  832. ^!InsertCode ^$StrUUEncode("^%Text%")$
  833.  
  834. H="UUDecode text"
  835. ;Converts the UUEncoded text in the current document to its native format and saves it to a new document
  836. ^!SetCode %Text%=^$GetText$
  837. ^!ToolBar New Document
  838. ^!InsertCode ^$StrUUDecode("^%Text%")$
  839.  
  840. H=";"
  841.  
  842.  
  843. H=";Encrypt/Decrypt"
  844. This section offers Clips that let you encrypt and decrypt data.
  845.  
  846.  
  847.  
  848. H="Create password"
  849. ^!Info [L]Password:^p^$StrRandom(^?[How long should the password be?=10];^?[(T=C)What type of characters can it have?=_Alphanumerical (mixed case)^=A..Za..z0..9|Alphanumerical (uppercase)^=A..Z0..9|Alphanumerical (lowercase)^=a..z0..9|Alphabetical (mixed case)^=A..Za..z|Alphabetical (uppercase)^=A..Z|Alphabetical (lowercase)^=a..z|Hexadecimal^=A..F0..9|Numerical^=0..9])$
  850.  
  851. H="ROT13 selection"
  852. ;Performs a ROT13 operation on the current document text. If no text is selected, then the whole text is converted.
  853. ^!If ^$GetSelSize$ = 0 ^!ToolBar Select All
  854. ^!InsertCode ^$StrRot13("^$GetSelection$")$
  855.  
  856. H="Encrypt file"
  857. ;Encrypts the data in the chosen file and saves the result to a new file with the extension .npw
  858. ^!FileScramble "^?[(T=O)File to Encrypt]" "^?[(T=S;F="Encrypted files (*.npw)|*.npw")Save as (leave blank for default name)]" "^?[Encryption key (leave blank for default key)]"
  859. ^!IfError ShowError
  860. ^!Prompt Encryption successful
  861. ^!Goto End
  862.  
  863. :ShowError
  864. ^!Prompt An error has occured during the encryption process
  865.  
  866.  
  867. H="Decrypt file"
  868. ;Decrypts the data in the chosen file and saves the result to a new file with its original name
  869. ^!FileScramble "^?[(T=O;F="Encrypted files (*.npw)|*.npw")File to Decrypt]" "^?[(T=S)Save as (leave blank for default name)]" "^?[Encryption key (leave blank for default key)]"
  870. ^!IfError ShowError
  871. ^!Prompt Decryption successful
  872. ^!Goto End
  873.  
  874. :ShowError
  875. ^!Prompt An error has occured during the decryption process
  876.  
  877.  
  878. H="Encrypt selection"
  879. ;Encrypts the selected text in the current document and pastes the result over the selection
  880. ^!If ^$GetSelSize$ = 0 NoText
  881. ^!Set %Key%=^?{Encryption key (leave blank for default key)}
  882. ^!Set %Text%=^$GetSelection$
  883. ^!Set %NewText%=^$StrEncrypt("^%Text%";"^%Key%")$
  884. ^!Set %CrcText%=^$GetCrcText("^%Text%")$
  885. ^!Set %CrcNewText%=^$GetCrcText("^$StrDecrypt("^%NewText%";"^%Key%")$")$
  886. ^!If ^%CrcText% <> ^%CrcNewText% Error
  887. ^!InsertCode ^%NewText%
  888. ^!Goto End
  889.  
  890. :NoText
  891. ^!Prompt Please select the text to encrypt before using this command
  892. ^!Goto End
  893.  
  894. :Error
  895. ^!Prompt An error occured during the encryption process
  896.  
  897. H="Decrypt selection"
  898. ;Decrypts the selected text in the current document and pastes the result over the selection
  899. ^!If ^$GetSelSize$ = 0 NoText
  900. ^!Set %Key%=^?{Encryption key (leave blank for default key)}
  901. ^!InsertCode ^$StrDecrypt("^$GetSelection$";"^%Key%")$
  902. ^!Goto End
  903.  
  904. :NoText
  905. ^!Prompt Please select the text to encrypt before using this command
  906.  
  907. H=";"
  908.  
  909.  
  910. H=";Message Digests"
  911. This section offers Clips that compute the message digest, or digital signature, of the provided data.
  912.  
  913.  
  914.  
  915. H="MD5 of file"
  916. ;Returns the MD5 signature of the chosen file
  917. ^!Set %FileName%=^?[(T=O)File to analyse]
  918. ^!Info MD5 signature of "^%FileName%": ^$GetMD5File("^%Filename%")$
  919.  
  920. H="MD5 of text"
  921. ;Returns the MD5 signature of the text in the current document
  922. ^!Info MD5 signature: ^$GetMD5Text("^$GetText$")$
  923.  
  924. H="CRC32 of file"
  925. ;Returns the CRC32 signature of the chosen file
  926. ^!Set %FileName%=^?[(T=O)File to analyse]
  927. ^!Info CRC32 signature of "^%FileName%": ^$StrLower("^$IntToHex(^$GetCrcFile("^%Filename%")$)$")$
  928.  
  929. H="CRC32 of text"
  930. ;Returns the CRC32 signature of the text in the current document
  931. ^!Info CRC32 signature: ^$StrLower("^$IntToHex(^$GetCrcText("^$GetText$")$)$")$
  932.  
  933.  
  934. H=";"
  935.  
  936.  
  937. H=";NoteTab Shortcuts"
  938. This section offers Clips that add shortcuts to NoteTab from various places under Windows.
  939.  
  940.  
  941.  
  942. H="Add SendTo Shortcut"
  943. ^!MakeShortcut SendTo "^$GetAppFileName$" "" "^$GetProgName$"
  944. ^!IfError ShowError
  945.  
  946. ^!Prompt "SendTo" shortcut has been added to Windows Explorer popup menu
  947. ^!Goto End
  948.  
  949. :ShowError
  950. ^!Prompt Error creating shortcut
  951.  
  952.  
  953. H="Add to Edit HTML file type"
  954. ^!SaveRegValue HKEY_CLASSES_ROOT\htmlfile\shell\edit\command="^$GetAppFileName$" "%1"
  955. ^!IfError ShowError
  956.  
  957. ^!Prompt "Edit HTML file type" shortcut has been added to the registry
  958. ^!Goto End
  959.  
  960. :ShowError
  961. ^!Prompt Error creating registry key
  962.  
  963.  
  964. H="Add IE Default HTML Editor"
  965. ^!SaveRegValue HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\View Source Editor\Editor Name=^$GetAppFileName$
  966. ^!IfError ShowError
  967. ^!SaveRegValue HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Default HTML Editor\shell\edit=^$GetAppFileName$
  968. ^!IfError ShowError
  969. ^!SaveRegValue HKEY_CLASSES_ROOT\.htm\OpenWithList\^$GetProgName$\shell\edit\command="^$GetAppFileName$" "%1"
  970.  
  971. ^!Prompt "View Source Editor", "Default HTML Editor", and "Browser Open-with-List" shortcuts for Internet Explorer have been added to the registry
  972. ^!Goto End
  973.  
  974. :ShowError
  975. ^!Prompt Error creating registry key
  976.  
  977.  
  978. H="Restore IE Default HTML Editor"
  979. ^!SaveRegValue HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\View Source Editor\Editor Name=Notepad.exe
  980. ^!IfError ShowError
  981. ^!SaveRegValue HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Default HTML Editor\shell\edit=Notepad.exe
  982. ^!IfError ShowError
  983.  
  984. ^!Prompt "View Source Editor", "Default HTML Editor", and "Browser Open-with-List" shortcuts for Internet Explorer have been restored to Windows Notepad
  985. ^!Goto End
  986.  
  987. :ShowError
  988. ^!Prompt Error creating registry key
  989.  
  990.  
  991. H=";"
  992.  
  993.  
  994. H=";Fookes Software links"
  995. This section offers Clips that launch your default web browser and connect to the chosen site. Just double click on the Clip to open the web page.
  996.  
  997.  
  998.  
  999. H="Fookes Software"
  1000. ^!URL http://www.fookes.com/
  1001.  
  1002. H="NoteTab Homepage"
  1003. ^!URL http://www.notetab.com/
  1004.  
  1005. H="Clipbook Repository"
  1006. ^!URL http://www.notetab.com/libraries.htm
  1007.  
  1008. H=";"
  1009.  
  1010.  
  1011. H=";________________"
  1012.  
  1013.  
  1014. H="_FillLibraryList"
  1015. ;Clear variable in case it has been used previously
  1016. ^!ClearVariable %LibraryList%
  1017. ;Retrieve first library name that matches specified search criteria
  1018. ^!Set %LibraryName%=^$GetFileFirst(^$GetLibraryPath$;"*.clb";Name)$
  1019. ^!IfTrue ^$IsEmpty(^%LibraryName%)$ End
  1020.  
  1021. :StartLoop
  1022. ;Append library name without path and extension to variable. Name is preceded with a space in case it starts with a special character. This space will have to be removed later
  1023. ^!Append %LibraryList%= ^$GetName("^%LibraryName%")$|
  1024. ;Get next matching library name and go back to start of loop
  1025. ^!Set %LibraryName%=^$GetFileNext$
  1026. ;If the library name variable contains text, continue the loop
  1027. ^!IfFalse ^$IsEmpty(^%LibraryName%)$ StartLoop
  1028.  
  1029. ;Close the file-find variable to restore system resources
  1030. ^!CloseFileFind
  1031.  
  1032. ;Get size of library list
  1033. ^!Set %SizeList%=^$StrSize("^%LibraryList%")$
  1034. ;Substract one from the SizeList value
  1035. ^!Dec %SizeList%
  1036. ;Format list so it can be used in Clip wizard
  1037. ^!Set %LibraryList%=^$StrCopy("^%LibraryList%";1;^%SizeList%)$
  1038.